﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;



namespace DataTier
{
    [KnownType(typeof(Booking))]
    [DataContract(IsReference = true)]
    public class Route
    {
        private List<Booking> _bookings;
        private int _routeId;
        private int _fromZip;
        private string _fromCity;
        private string _fromAdress;
        private DateTime _startDate;
        private int _toZip;
        private string _toCity;
        private string _toAdress;
        private DateTime _endDate;


        #region Constructors

        public Route(int routeId, int fromZip, string fromCity, string fromAdress, DateTime startDate, int toZip, string toCity, string toAdress, DateTime endDate)
        {
            this._routeId = routeId;
            this._fromZip = fromZip;
            this._fromCity = fromCity;
            this._fromAdress = fromAdress;
            this._startDate = startDate;
            this._toZip = toZip;
            this._toCity = toCity;
            this._toAdress = toAdress;
            this._endDate = endDate;
            this._bookings = new List<Booking>();

        }

        public Route(int fromZip, string fromCity, string fromAdress, DateTime startDate, int toZip, string toCity, string toAdress, DateTime endDate)
        {
            this._fromZip = fromZip;
            this._fromCity = fromCity;
            this._fromAdress = fromAdress;
            this._startDate = startDate;
            this._toZip = toZip;
            this._toCity = toCity;
            this._toAdress = toAdress;
            this._endDate = endDate;
            this._bookings = new List<Booking>();


        }

        public Route(int routeId)
        {
            this._routeId = routeId;
        }

        #endregion

        #region Properties

        [DataMember]
        public int RouteId
        {
            get {return _routeId; }
            set { _routeId = value; }
        }

        [DataMember]
        public int FromZip
        {
            get { return _fromZip; }
            set { _fromZip = value; }
        }

        [DataMember]
        public string FromCity
        {
            get { return _fromCity; }
            set { _fromCity = value; }
        }

        [DataMember]
        public string FromAdress
        {
            get { return _fromAdress; }
            set { _fromAdress = value; }
        }

        [DataMember]
        public DateTime StartDate
        {
            get { return _startDate; }
            set { _startDate = value; }
        }

        [DataMember]
        public List<Booking> Bookings
        {
            get { return _bookings; }
            set { _bookings = value; }
        }

        [DataMember]
        public int ToZip
        {
            get { return _toZip; }
            set { _toZip = value; }
        }

        [DataMember]
        public string ToCity
        {
            get { return _toCity; }
            set { _toCity = value; }
        }

        [DataMember]
        public string ToAdress
        {
            get { return _toAdress; }
            set { _toAdress = value; }
        }

        [DataMember]
        public DateTime EndDate
        {
            get { return _endDate; }
            set { _endDate = value; }
        }

      

        #endregion
    }
}
